#include <asm.h>
#include <csr.h>

ENTRY(setup_exception)

  /* TODO: [p2-task3] save exception_handler_entry into STVEC */
  la   a0, exception_handler_entry
  csrw stvec, a0



  /* TODO: [p2-task4] enable interrupts globally */
  
  not  t0, zero
  csrs sie, t0 
  
  li   t0, SR_SIE
  csrs sstatus, t0
  

  jr ra

ENDPROC(setup_exception)
